/*
* 单人房 KTV
* */

import request from '@/utils/request'

/*
* 主播审核
* */
export function presenterAuth({
  category_id,
  user_code,
  nickname,
  status,
  admin_id,
  auth_date,
  date,
  page
}) {
  return request.get('/presenter/auth', {
    params: {
      category_id,
      user_code,
      nickname,
      status,
      admin_id,
      auth_date,
      date,
      page
    }
  })
}

/*
* 主播审核详情
* */
export function presenterAuthById(id) {
  return request.get(`/presenter/auth/${id}`)
}

/*
* 主播审核
* */
export function presenterAuthByIdPut(id, { status, reject_reason }) {
  return request({
    url: `/presenter/auth/${id}`,
    method: 'put',
    params: {
      status,
      reject_reason
    }
  })
}

/*
* 主播题目删除
* */
export function presenterSubjectById(id) {
  return request({
    url: `/presenter/subject/${id}`,
    method: 'delete'
  })
}

/*
* 主播题目修改
* */
export function presenterSubjectByIdPut({ id, category_id, title, content, is_visible }) {
  return request({
    url: `/presenter/subject/${id}`,
    method: 'put',
    data: {
      category_id,
      title,
      content,
      is_visible
    }
  })
}

/*
* 主播题目创建
* */
export function presenterSubjectByIdPost({ category_id, title, content, is_visible }) {
  return request({
    url: `/presenter/subject`,
    method: 'post',
    data: {
      category_id,
      title,
      content,
      is_visible
    }
  })
}

/*
* 主播题目
* */
export function presenterSubject(category_id, { page, per_page = 15 }) {
  return request({
    url: `/presenter/subject`,
    params: {
      page,
      category_id,
      per_page
    }
  })
}

/*
* 主播题目分类
* */
export function presenterSubjectCategory(page) {
  return request({
    url: `/presenter/subject/category`,
    params: {
      page
    }
  })
}

/*
* 主播题目分类修改
* */
export function presenterSubjectCategoryById({ id, name, is_visible }) {
  return request({
    url: `/presenter/subject/category/${id}`,
    method: 'put',
    data: {
      name,
      is_visible
    }
  })
}

/*
* 主播题目分类创建
* */
export function presenterSubjectCategoryPost({ name, is_visible }) {
  return request({
    url: `/presenter/subject/category`,
    method: 'post',
    data: {
      name,
      is_visible
    }
  })
}
